import service from "@/util/request";

// 获取权限信息
export function getPre() {
    return service({
        url: '/sys/pre/getPre',
        method: 'get'
    })
}

// 模糊查询权限信息
export function SelectPre(role, pre) {
    let url = "/sys/pre/query?";
    if (role != "") {
        url += "role=" + role + "&";
    }
    if (pre != "") {
        url += "pre=" + pre;
    }
    return service({
        url,
        method: 'get'
    })
}

// 添加权限信息
export function addPre(data) {
    return service({
        url: '/sys/pre/addPre',
        method: 'post',
        data,
    })
}

// 删除权限信息
export function removePre(id) {
    return service({
        url: '/sys/pre/delete/' + id,
        method: 'get',
    })
}

// 修改权限信息
export function editPre(data) {
    return service({
        url: 'sys/pre/edit',
        method: 'post',
        data
    })
}